package com.cc.web.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.cc.infrastructure.special.dto.PerformanceDo;
import com.cc.infrastructure.db.PerformanceDb;

import java.sql.Timestamp;


@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("前端传递参数")
public class PerformanceVo {

  /**
   *
   **/
  @ApiModelProperty("")
  private String id;
  /**
   * 通知书合同函id
   **/
  @ApiModelProperty("通知书合同函id")
  private String rnNoticeLetterId;
/**
 *  主体类型（1：采购
 2：供应商
 )
 **/
  @ApiModelProperty("主体类型（1：采购
    2：供应商
  )
" )
  private String subjectType;
  /**
   * 主体id
   **/
  @ApiModelProperty("主体id")
  private String rnSubjectId;
  /**
   * 履约状态（1履约中 2完成）
   **/
  @ApiModelProperty("履约状态（1履约中 2完成）")
  private String state;
  /**
   * 履约情况
   **/
  @ApiModelProperty("履约情况")
  private String content;
  /**
   * 履约情况相关附件
   **/
  @ApiModelProperty("履约情况相关附件")
  private String file;
  /**
   * 创建时间
   **/
  @ApiModelProperty("创建时间")
  private Timestamp ctime;
  /**
   * 更新时间
   **/
  @ApiModelProperty("更新时间")
  private Timestamp mtime;

  public static PerformanceVo convertPerformanceVoByPerformanceDo(PerformanceDo performanceDo) {
    PerformanceVo performancevo = new PerformanceVo();
    performancevo.setId(performanceDo.getId());
    performancevo.setRnNoticeLetterId(performanceDo.getRnNoticeLetterId());
    performancevo.setSubjectType(performanceDo.getSubjectType());
    performancevo.setRnSubjectId(performanceDo.getRnSubjectId());
    performancevo.setState(performanceDo.getState());
    performancevo.setContent(performanceDo.getContent());
    performancevo.setFile(performanceDo.getFile());
    performancevo.setCtime(performanceDo.getCtime());
    performancevo.setMtime(performanceDo.getMtime());
    return performancevo;
  }

  public static PerformanceVo convertPerformanceVoByPerformanceDo(PerformanceDb performanceDb) {
    PerformanceVo performancevo = new PerformanceVo();
    performancevo.setId(performanceDb.getId());
    performancevo.setRnNoticeLetterId(performanceDb.getRnNoticeLetterId());
    performancevo.setSubjectType(performanceDb.getSubjectType());
    performancevo.setRnSubjectId(performanceDb.getRnSubjectId());
    performancevo.setState(performanceDb.getState());
    performancevo.setContent(performanceDb.getContent());
    performancevo.setFile(performanceDb.getFile());
    performancevo.setCtime(performanceDb.getCtime());
    performancevo.setMtime(performanceDb.getMtime());
    return performancevo;
  }
}